#include <iostream>

int Gcd(int a, int b) {
	if (b == 0) {
		return a;
	}
	return Gcd(b, a % b);
}

struct Node {
	int APrime;
	int BPrime;
};

/**
 * 比例简化
 */
int main() {
	int A, B, L;
	std::cin >> A >> B >> L;

	double real = A * 1.0 / B;
	double diff = 1e6;
	Node result = {};
	for (int APrime = 1; APrime <= L; APrime++) {
		for (int BPrime = 1; BPrime <= L; BPrime++) {
			if (Gcd(APrime, BPrime) != 1) {
				continue;
			}

			double temp = APrime * 1.0 / BPrime;
			if (temp < real) {
				continue;
			}

			if (temp - real < diff) {
				diff = temp - real;
				result.APrime = APrime;
				result.BPrime = BPrime;
			}
		}
	}

	std::cout << result.APrime << " " << result.BPrime;

	return 0;
}
